
package com.feib.soeasy.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.feib.soeasy.dao.RealAccountDao;
import com.feib.soeasy.model.RealAccount;
import com.feib.soeasy.pagination.PaginatedList;
import com.feib.soeasy.service.RealAccountService;


/**
 * @title (#)RealAccountServiceImpl.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2011/2/12 create by Jimmy Liu<br>
 */
@Service("realAccountService")
public class RealAccountServiceImpl extends BaseServiceImpl implements RealAccountService {

    @Resource(name="realAccountDao")
    private RealAccountDao realAccountDao;

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.RealAccountService#queryByRealAccount(com.feib.soeasy.model.RealAccount, com.feib.soeasy.pagination.PaginatedList)
     */
    @Override
    public PaginatedList<RealAccount> queryByRealAccount(RealAccount realAccount, PaginatedList<RealAccount> paginationConfig) {
        return realAccountDao.queryPaginationByRealAccount(realAccount, paginationConfig);
    }

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.RealAccountService#addRealAccount(com.feib.soeasy.model.RealAccount)
     */
    @Override
    public RealAccount addRealAccount(RealAccount realAccount) {
        return realAccountDao.save(realAccount);
    }

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.RealAccountService#save(com.feib.soeasy.model.RealAccount)
     */
    @Override
    public RealAccount save(RealAccount realAccount) {
        return realAccountDao.save(realAccount);
    }

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.RealAccountService#queryByPk(java.lang.Long)
     */
    @Override
    public RealAccount queryByPk(Long pk) {
        return realAccountDao.findByPk(pk);
    }

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.RealAccountService#deleteRealAccount(com.feib.soeasy.model.RealAccount)
     */
    @Override
    public void deleteRealAccount(RealAccount editRealAccount) {
        realAccountDao.deleteById(editRealAccount.getRealAccountPk());
    }
    
    public RealAccount queryByGroupVirtualAccount(RealAccount realAccount)
    {
        return realAccountDao.queryByGroupVirtualAccount(realAccount);
    }

}
